import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/certificate/list',
    method: 'get',
    params: query
  })
}
export function getCredentials() {
  return request({
    url : '/credentials/getAll',
    method:'get'
  })
}

export function delcertificate(certificate_id) {
  return request({
    url:'/certificate/delcertificate/'+certificate_id,
    method:'get',
  })
}

export function delremind(certificate_id) {
  return request({
    url:'/certificate/remindDelete/'+certificate_id,
    method:'get',
  })
}

export function fetchcertificate(id) {
  return request({
    url: '/certificate/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: '/certificate/pv',
    method: 'get',
    params: { pv }
  })
}

export function createcertificate(data) {
  return request({
    url: '/certificate/create',
    method: 'post',
    data
  })
}

export function updatecertificate(data) {
  return request({
    url: '/certificate/update',
    method: 'post',
    data
  })
}

export function certificateSync(data) {
  return request({
    url: '/sync/certificate',
    method: 'post',
    data
  })
}
